-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ignore: handling of broken symlinks #1503
ignore: handling of broken symlinks #1503
Conversation
Interesting question. It kind of feels to me like the current API is probably right though? The user is asking for symlinks to be followed, so So if the caller asked to follow symlinks, and you yield a dir entry with a symlink that could not be followed, then how are methods like Moreover, if we decided to return a Your point about |
Thank you so much for your detailed response!
Right. I hadn't thought about that.
According to
So in this sense, I would expect a Since
Agreed, I see your point.
We had two failed attempts at fixing this bug (sharkdp/fd#357) in
We currently get a |
I found a way to make this work: sharkdp/fd@cc08493...9fe73ba I think we can close this(?). Maybe the only thing to note is that users of |
As you probably know, VS Code depends on ripgrep to find files by name: https://github.com/microsoft/vscode/blob/ab49f4f310a014c9e03839f37c1ca3c48196aeca/src/vs/workbench/services/search/node/fileSearch.ts#L200 |
This is maybe more of a question than a bug report.
Currently, the
ignore
crate has the following behavior:.follow_links(false)
: both broken and normal symlinks are reported as directory entries. This is as expected..follow_links(true)
: normal symlinks are reported as directory entries (and traversed, if they point to a directory), broken symlinks are not reported (anignore::Error::WithPath
is returned from the iterator).Question: in the
follow_links(true)
case, do we expect to see broken symlinks as normal directory entries?I would argue yes, they should be reported. Broken symlinks are file-like directory entries which should show up when "walking a directory" with
ignore
. This is backed byfind
s behavior, which does report broken symlinks, even when-follow
is present.This is a PR which adds a (currently failing) unit test, which can be used as a basis to fix this, if desired. I tried to implement a fix myself, but didn't get very far: